package com.xu.service;

import com.xu.mapper.StockMapper;
import com.xu.pojo.Stock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockServiceImpl implements StockService {

    @Autowired
    private StockMapper stockMapper;

    public void setStockMapper(StockMapper stockMapper) {
        this.stockMapper = stockMapper;
    }


    public List<Stock> getStock()
    {
        return stockMapper.getStock();
    }

    public int addStock(Stock stock)
    {
        return stockMapper.addStock(stock);
    }

    public int delStock(int id) {
        return stockMapper.delStock(id);
    }

    public int updStock(Stock stock) {
        return stockMapper.updStock(stock);
    }

    public Stock queryStockById(int id) {
        return stockMapper.queryStockById(id);
    }
}
